//@author A0101119Y
#include "Poco/Net/HTTPClientSession.h"
#include "Poco/Net/HTTPSClientSession.h"
#include "Poco/Net/HTTPRequest.h"
#include "Poco/Net/HTTPResponse.h"
#include "Poco/Util/Application.h"
#include "Poco/StreamCopier.h"
#include "Poco/Path.h"
#include "Poco/URI.h"
#include "Poco/Exception.h"
#include "GCalParser.h"
#include "GCalVariableMgr.h"
#include "GAccountsRequestAgent.h"
#include "GoogleRequestAgent.h"
#include "CommonObjects.h"
#include <string>
#include <vector>
#include <sstream>
#include <map>

namespace Twentyfifth {
	class GCalRequestAgent : public GoogleRequestAgent {
	protected:
	public:
		GCalVariableMgr variablemgr;
		static const std::string GCAL_HOSTNAME;
		static const std::string GCAL_API_CALENDAR;
		static const std::string GCAL_PATH_ADDCALENDAR;
		static const std::string GCAL_PATH_CALENDARLIST;
		static const std::string GCAL_PATH_CALENDAR;
		static const std::string GCAL_PATH_EVENTS;
		static const std::string GCAL_PATH_QUICKADD;
		static const std::string HEADER_AUTHORIZATION;
		static const std::string HEADER_CONTENT_TYPE;
		static const std::string VALUE_JSON;
		static const std::string VALUE_BEARER;
		static const std::string LABEL_GCAL_ID;
		static const std::string PARAM_SINGLE_EVENTS;
		static const std::string PARAM_GCAL_QUICKADD;
		static const std::string LABEL_ACCESS_TOKEN;
		static const std::string LABEL_CALENDAR_ID;
		static const std::string LABEL_CALENDAR_NAME;
		static const std::string LABEL_CALENDAR_TIMEZONE;
		static const std::string LABEL_ITEMS;
		static const std::string PLACEHOLDER_STRING;
		static const std::string CHAR_SPACE;
		static const std::string CHAR_PLUS;
	public:
		std::string getCalendars();
		std::string addCalendar(std::string name);
		std::string getEvents(std::string calId);
		std::string addEvent(std::string calId, Task t);
		void deleteEvent(std::string calId, Task t);
		void editEvent(std::string calId, Task t);
		std::string quickAddEvent(std::string calId, std::string input);
	};
}